<?php
class OptionController extends AdminController
{
     /**
     * 操作日志
     */
    public function actionIndex()
    {
        $attr['year'] = Yii::app()->request->getQuery('year','');
        $attr['month'] = Yii::app()->request->getQuery('month','');
        $attr['day'] = Yii::app()->request->getQuery('day','');
        $attr['u_id'] = Yii::app()->request->getQuery('u_id','');
        $attr['module_id'] = Yii::app()->request->getQuery('module_id','');
        $attr['keyword'] = Yii::app()->request->getQuery('keyword');
        $page = Yii::app()->request->getQuery('page',1);
        $page_size = Yii::app()->request->getQuery('page_size',20);
        if ( empty($attr['year']) || empty($attr['month'])) {
            $attr['month'] = '';
            $attr['year'] = '';
        }
        $result = OptionLog::model()->getList($attr, $page, $page_size);
        $search = $attr;
        $this->setPageTitle('操作日志');
        $manager_data = Manager::model()->managers();
        $managers = $manager_data['managers'];
        ##获取模块
        $modules = BaseActiveRecord::$static_modules;
        $this->render("index",compact("result","search","managers","modules"));
    }
    public function actionDetail()
    {
        $id = Yii::app()->request->getQuery('id','');
        $result = OptionLog::model()->getDetail($id);
        $this->setPageTitle('操作日志-详情');
        $this->render("detail",compact("result"));
    }
}
